Repository navigation
Fix NullPointerException when offloading a consuming upsert segment with metadataTTL - #20385
Open
Indian-boult wants to merge 1 commit into
Open
Indian-boult wants to merge 1 commit into
Indian-boult wants to merge 1 commit into
Conversation
removeSegment asks isOutOfMetadataTTL whether to keep the metadata of the segment, and isOutOfMetadataTTL reads the max comparison value from the column metadata. A consuming segment has no column metadata, so offloading it from a table with metadataTTL threw a NullPointerException and the CONSUMING to OFFLINE or DROPPED transition failed. A consuming segment holds the latest records of the partition, so it is now always treated as within TTL and its primary keys are removed. Fixes apache#20384
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #20385 +/- ##
=============================================
+ Coverage 61.23% 71.47% +10.23%
- Complexity 1 1633 +1632
=============================================
Files 2793 3615 +822
Lines 180530 244529 +63999
Branches 30232 39771 +9539
=============================================
+ Hits 110556 174768 +64212
+ Misses 60642 56564 -4078
- Partials 9332 13197 +3865
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #20384
isOutOfMetadataTTLnow returns false for aMutableSegment. A consuming segment has no column metadata to read its max comparison value from, and it holds the newest records of its partition, so it is always within TTL. Offloading it now removes its primary keys like any other segment that is within TTL.ConcurrentMapPartitionUpsertMetadataManagerTest.testOffloadConsumingSegmentWithMetadataTTLbuilds a realMutableSegmentImplwith metadataTTL 30, indexes three rows and offloads it. On master it throws the NullPointerException from the issue. With the change it passes, and so do the 87 tests in the upsert metadata manager test classes. Spotless, checkstyle and license checks pass on pinot-segment-local.